import os
from dotenv import load_dotenv, find_dotenv

# from pathlib import Path  # Python 3.6+ only
from utils import Console

# 一、自动搜索 .env 文件
load_dotenv(find_dotenv(), verbose=True)
# env_path = Path('.') / '../.env'
# load_dotenv(dotenv_path=env_path, verbose=True)
# Console.info(os.environ)


env = 'testing'

# Load the appropriate .env file
if env == 'testing':
    load_dotenv('.env.testing')
elif env == 'development':
    load_dotenv('.env.dev')
elif env == 'production':
    load_dotenv('.env.production')

SECRET_KEY = os.getenv("EMAIL")
REDIS_ADDRESS = os.getenv("REDIS_ADDRESS")

Console.error({'SECRET_KEY': SECRET_KEY, 'REDIS_ADDRESS': REDIS_ADDRESS})
# Get specific environment variables
# api_key = os.environ['API_KEY']
# secret_key = os.environ['SECRET_KEY']

# Print environment variables
# print(api_key)
# print(secret_key)
